package com.milestone.fitnesspersonaltrainer.repository.imp;


import com.milestone.fitnesspersonaltrainer.model.CategoryModel;
import com.milestone.fitnesspersonaltrainer.model.Course;
import com.milestone.fitnesspersonaltrainer.model.Diet;
import com.milestone.fitnesspersonaltrainer.model.HomeModel;
import com.milestone.fitnesspersonaltrainer.model.News;
import com.milestone.fitnesspersonaltrainer.network.RetrofitBuilder;
import com.milestone.fitnesspersonaltrainer.network.response.RxVoid;
import com.milestone.fitnesspersonaltrainer.network.rx.BaseResponseFunc1;
import com.milestone.fitnesspersonaltrainer.repository.api.FitnessRepo;
import com.milestone.fitnesspersonaltrainer.repository.api.WallpaperRepo;
import com.milestone.fitnesspersonaltrainer.service.FitnessService;
import com.milestone.fitnesspersonaltrainer.service.WallpaperService;

import org.androidannotations.annotations.AfterInject;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EBean;

import java.util.ArrayList;

import io.reactivex.Flowable;

/**
 * Created by ThinkPad on 2017/11/2.
 */
@EBean(scope = EBean.Scope.Singleton)
public class FitnessRepoImp implements FitnessRepo {

    @Bean
    RetrofitBuilder mRetrofitBuilder;
    private FitnessService fitnessService;

    @AfterInject
    void initService() {
        fitnessService = mRetrofitBuilder.build().create(FitnessService.class);
    }

    @Override
    public Flowable <ArrayList <Course>> getCourseHome(String url) {
        return fitnessService.getCourse(url).flatMap(new BaseResponseFunc1<ArrayList<Course>>());
    }

    @Override
    public Flowable <ArrayList <News>> getNewsHome(int pageIndex) {
        return null;
    }

    @Override
    public Flowable <ArrayList <Diet>> getDietHome() {
        return null;
    }

    @Override
    public Flowable <ArrayList <Diet.DietBean>> getDietList(int pageIndex, String type) {
        return null;
    }
}
